package com.epam.matchers;

import java.util.regex.Pattern;

import com.epam.resources.Resources;
import com.epam.text_elements.PunctuationMark;

public class PunctuationMarkMatcher extends AbstractMatcher {
	private static final Pattern PATTERN = Pattern.compile(
			Resources.getString("PunctMarkMatcherPattern"));
	
	public PunctuationMarkMatcher(String src) {
		super(src);
	}

	public PunctuationMark getNextPunctationMark(int nextPunctMarkPosition) {
		String temp = super.nextStringElement(PATTERN, nextPunctMarkPosition);
		PunctuationMark res=null;
		if (temp != null) {
			res=new PunctuationMark(temp.charAt(0));
			/*switch (temp) {
			case ",":
				return PunctationMark.COMMA;
			case ".":
				return PunctationMark.PERIOD;
			case "-":
				return PunctationMark.DASH;
			case ":":
				return PunctationMark.COLON;
			case ";":
				return PunctationMark.SEMICOLON;
			case "!":
				return PunctationMark.EXCLAMATION_MARK;
			case "?":
				return PunctationMark.QUESTION_MARK;
			case "\"":
				return PunctationMark.QUOTATION_MARK;
			case "'":
				return PunctationMark.APOSTROPHE;
			case "[":
				return PunctationMark.LEFT_SQUARE_BRACKET;
			case "]":
				return PunctationMark.RIGHT_SQUARE_BRACKET;
			case "(":
				return PunctationMark.LEFT_BRACKET;
			case ")":
				return PunctationMark.RIGHT_BRACKET;
			case "{":
				return PunctationMark.LEFT_CURLY_BRACKET;
			case "}":
				return PunctationMark.RIGHT_CURLY_BRACKET;
			case "<":
				return PunctationMark.LEFT_ANGLE_BRACKET;
			case ">":
				return PunctationMark.RIGHT_ANGLE_BRACKET;
			case "/":
				return PunctationMark.SLASH;
			case "\\":
				return PunctationMark.BACKSLASH;
			case "&":
				return PunctationMark.AMPERSAND;
			case "*":
				return PunctationMark.ASTERISK;
			case "#":
				return PunctationMark.HASH;
			case "@":
				return PunctationMark.AT;
			case "%":
				return PunctationMark.PERCENT;
			case "~":
				return PunctationMark.TILDE;
			case "_":
				return PunctationMark.UNDERSCORE;
			case "|":
				return PunctationMark.VERTICAL_BAR;
			case "$":
				return PunctationMark.DOLLAR_SIGN;
			case "+":
				return PunctationMark.PLUS;
			case " ":
				return PunctationMark.SPACE;
			}*/
		} 
		return res;
	}
}
